<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    * {
        padding: 0;
        margin: 0;
    }
</style>
</head>
<body>
    
<div class="map"></div>

<button class="start">开始</button>
<button class="stop">停止</button>


<script src="./js/snake.js"></script>
<script src="./js/map.js"></script>
<script src="./js/game.js"></script>
<script src="./js/food.js"></script>

<script>
    const g = new Game('.map')

    const start = document.querySelector('.start')
    const stop = document.querySelector('.stop')

    start.addEventListener('click', () => g.start())
    stop.addEventListener('click', () => g.stop())
    // const restart = document.querySelector('.restart')
    // restart.addEventListener('click', () => g.restart())
</script>

</body>
</html>
